import 'dart:io';

import 'package:http_multi_server/http_multi_server.dart';
import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf/shelf_io.dart' as shelf_io;

class HttpServerUtils {
  HttpServerUtils._internal();
  static final HttpServerUtils _httpServer = HttpServerUtils._internal();
  factory HttpServerUtils() {
    return _httpServer;
  }

  void initHttpServer() async {
    HttpServer.bind(InternetAddress.anyIPv6, 8080, shared: true).then((server) {
      server.listen((HttpRequest request) {
        print("request===${request}");
        request.response.write(
            '{"SharedPrefe_MERGE_HOST_ID":166,"SharedPrefe_MERGE_TOTAL_COLUMN":1,"SharedPrefe_MERGE_TOTAL_ROW":2,"SharedPrefe_MERGE_COLUMN":1,"SharedPrefe_MERGE_ROW":2,"name":"6C21A223302F","SharedPrefe_MERGE_IS_MASTER":0}');
        request.response.close();
      });
    });
  }
}
